package com.zr.inquiryenum;

/**
 * Created by 天赐 on 2019/12/25.
 */

public enum currencyCodeEnum {

    RENMINBI("人民币",1),MEIYUAN("美元",0);

    private String name;
    private Integer value;

    private currencyCodeEnum(String name, Integer value){
        this.name=name;
        this.value=value;

    }
    //普通方法 通过value获取名称
    public static  String getName(Integer value) {
        for (currencyCodeEnum c: currencyCodeEnum.values()) {
            if (c.getValue()==value){
                return c.name;
            }
        }
        return null;
    }
    public String getName(){
        return name;
    }
    public Integer getValue(){
        return value;
    }
}
